package org.huifei.a8_staticproxy;

/**
 * Created by huifei on 2017/7/11.
 */
public class ProxySubject implements Subject {

    private RealSubject realSubject;

    @Override
    public void request() {

        this.before();

        if (null == realSubject) {

            realSubject = new RealSubject();

        }

        realSubject.request();

        this.after();

    }


    public void before() {
        System.out.println("before ...");
    }

    public void after() {
        System.out.println("after ...");
    }
}
